package planclient;




	import graphique.VueEmployeJour;

import java.awt.Image;
import java.util.Dictionary;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;

	import javax.annotation.PostConstruct;
import javax.inject.Inject;

	import modele.Employe;
import modele.Employes;

	import org.eclipse.core.internal.runtime.InternalPlatform;
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.LightweightSystem;
import org.eclipse.draw2d.RectangleFigure;
import org.eclipse.draw2d.Shape;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.e4.core.contexts.EclipseContextFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.ui.di.Focus;
import org.eclipse.e4.ui.di.Persist;
import org.eclipse.e4.ui.di.UIEventTopic;
import org.eclipse.e4.ui.model.application.ui.MDirtyable;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
import org.eclipse.jface.resource.FontDescriptor;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.widgets.*;
import org.eclipse.ui.part.ViewPart;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
import org.osgi.service.event.Event;
import org.osgi.service.event.EventConstants;
import org.osgi.service.event.EventHandler;





	public class AffEmployeSched extends ViewPart{

		private Text txtInput;
		private TableViewer viewer;
		Employes listeEmployes;

		@Inject
		private MDirtyable dirty;
		private FormToolkit toolkit;
	 	private ScrolledForm form;
		private Employe emp;
		private Label Name;

		@PostConstruct
		public void createComposite(Composite parent,MPart part) {
			

			//
			   emp = (Employe) part.getObject();
			   
			   //LAyout 
				 toolkit = new FormToolkit(parent.getDisplay());
				 
				 
				  

				    
				 
			 //  parent = form2;
			   
			   
			   GridLayout  layout = new GridLayout();
			    layout.numColumns = 1;
			    layout.marginWidth = 0;
			    layout.marginHeight = 0;
			    parent.setLayout(layout);
			   
			
			    /// Entete 
			   
				 toolkit.setBorderStyle(0);
				// Form f2 = toolkit.createForm(parent);
				// f2.setSize(100, 100);
				 toolkit.createText(parent, "TEST");
				 
				 
				 Label label = new Label(parent, SWT.NONE);
				 FontData fontData = label.getFont().getFontData()[0];

				 Font font = new Font(parent.getDisplay(), new FontData(fontData.getName(), fontData
						    .getHeight(), SWT.ITALIC));
				 label.setFont(font);
				 label.setText("Bold Label");
				 
				 
				 
				 //Bouton
			/*	 Composite C2 = toolkit.createComposite(parent);
				 FormToolkit toolkit2 = new FormToolkit(C2.getDisplay());
				 GridLayout  layout2 = new GridLayout();
				 layout2.numColumns = 3;
				    layout2.marginWidth = 0;
				    layout2.marginHeight = 0;
				 C2.setLayout(layout2);
				 toolkit2.createText(C2, "TEST 2");
				 toolkit2.createText(C2, "TEST 3");
				 toolkit2.createText(C2, "TEST 4");*/
				 
			  
			    
			       
			       
			   //Icone 
				

			    
			 
			   
				 VueEmployeJour canvas = new VueEmployeJour(parent,SWT.NONE);
				 //Set sze of widget
				 final GridData data = new GridData();
				 data.widthHint = canvas.getSize().x;
				 data.heightHint =canvas.getSize().y;
				 canvas.setLayoutData(data);
				 
			  
			  

			   
			    
			    
			  }
		  



		@Focus
		public void setFocus() {
			// get employe
			// get employe
			
				
			
			//viewer.getTable().setFocus();
		}

		@Persist
		public void save() {
			dirty.setDirty(false);
		}




		@Override
		public void createPartControl(Composite parent) {
			// TODO Auto-generated method stub
			log.logger.Infologg("CREATE");
			
		}
		
	}
